package zhongbo.java.air.dictionary.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import zhongbo.java.air.dictionary.model.AirAircraft;
import zhongbo.java.air.dictionary.model.AirAirport;
import zhongbo.java.air.dictionary.model.AirAlertZone;

import java.util.List;

/**
 * 机场信息表(AirAirport)表数据库访问层
 *
 * @author makejava
 * @since 2025-03-31 14:05:40
 */
@Mapper
public interface AirAirportMapper extends BaseMapper<AirAirport> {

    /**
     * 查询指定行数据
     *
     * @param offset 偏移量
     * @param pageSize 大小
     * @return 对象列表
     */
    @Select("SELECT * FROM air_airport ORDER BY id LIMIT #{pageSize} OFFSET #{offset}")
    List<AirAirport> queryAllByLimit(@Param("offset") int offset, @Param("pageSize") int pageSize);

    @Select("SELECT * FROM air_airport WHERE icao_code = #{icaoCode}")
    AirAirport selectByIcaoCode(@Param("icaoCode") String icaoCode);

    @Select("SELECT * FROM air_airport WHERE iata_code = #{iataCode}")
    AirAirport selectByIataCode(@Param("iataCode") String iataCode);

}